package com.lm.ChainOfResponsibility;

/**
 * 日志工厂，这里使用工厂模式来获取日志对象
 */
public class LoggerFactory {

    /**
     * 获取日志
     * @return
     */
    public static AbstractLogger getLogger(){
        ErrorLogger errorLogger = new ErrorLogger(AbstractLogger.ERROR);
        DebugLogger debugLogger = new DebugLogger(AbstractLogger.DEBUG);
        InfoLogger infoLogger = new InfoLogger(AbstractLogger.INFO);
        errorLogger.setNextLogger(debugLogger);
        debugLogger.setNextLogger(infoLogger);
        return errorLogger;
    }
}
